<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <script src="./vue.js"></script>
</head>
<body>
    <div id="app">
        {{a}}
        <p v-if="seen">现在你看到我了</p>
        <button v-on:click="hanld">点我</button>
      
    </div>
</body>
<script>
    var vm=new Vue({
        el:'#app',
        data:{
            a:'hello!',
            seen:false
            
        
            
        }, 
        methods:{
        hanld(){
            this.seen=!this.seen;
        },
        
       
        
        created: function () {
    // `this` 指向 vm 实例
    console.log('a is: ' + this.a)
      } ,
         beforeUpdate(){
            
          console.log('有数据更新')},
          updated(){
            console.log('更新完毕')},

        beforeMount(){
            console.log('挂载前')
        },
        mounted(){
            setTimeout(()=>{
                this.a='change!';
            },2000)
            
            
        }	
    
    }})
   
</script>
</html>